<%--
  Created by IntelliJ IDEA.
  User: humeng
  Date: 2022/10/19
  Time: 10:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>cook session</title>
</head>
<body>
<%
  Cookie cookie = new Cookie("username","zs");
  response.addCookie(cookie);


  Cookie[] cookies = request.getCookies();
  for (Cookie cookie1 : cookies) {
    System.out.println(cookie1);
  }


  HttpSession session1 = request.getSession();
  session1.setAttribute("username","ls");
  String username = (String) session1.getAttribute("username");

%>

</body>
</html>
